package com.andkrup.comm {
	import flash.events.IEventDispatcher;	
	import flash.events.Event;
	import flash.events.HTTPStatusEvent;
	import flash.events.SecurityErrorEvent;
	import flash.events.IOErrorEvent;
	import flash.events.ProgressEvent;
	
	/**
	 * @author Andkrup
	 */
	public function subscribeLoadListener(loader:IEventDispatcher, listener:ILoadListener):void{
		loader.addEventListener(Event.COMPLETE, listener.onLoadComplete, false, 0, true);
		loader.addEventListener(Event.OPEN, listener.onLoadOpen, false, 0, true);
		loader.addEventListener(Event.INIT, listener.onLoadInit, false, 0, true);
		loader.addEventListener(ProgressEvent.PROGRESS, listener.onLoadProgress, false, 0, true);
		loader.addEventListener(IOErrorEvent.IO_ERROR, listener.onLoadIOError, false, 0, true);
		loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, listener.onLoadSecurityError, false, 0, true);
		loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, listener.onLoadHttpStatus, false, 0, true);
	}
}